package com.haotian.coder.config;


import dev.langchain4j.model.chat.StreamingChatModel;
import dev.langchain4j.model.openai.OpenAiStreamingChatModel;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Data
@Configuration
@ConfigurationProperties(prefix = "langchain4j.open-ai.chat-model")
public class ReasoningStreamingChatModelConfig {

    private String apiKey;

    private String baseUrl;


    @Bean
    public StreamingChatModel  reasoningStreamingChatModel(){

        final String ModelName = "deepseek-chat";
        final int maxToken = 8192;
        // 生产环境使用：
        // final String modelName = "deepseek-reasoner";
        // final int maxTokens = 32768;

        return OpenAiStreamingChatModel.builder()
                .apiKey(apiKey)
                .modelName(ModelName)
                .maxTokens(maxToken)
                .baseUrl(baseUrl)
                .logRequests( true)
                .logResponses(true)
                .build();
    }
}
